/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Developer
 */
@Entity
@Table(name = "pos_transaction_bonus_sales_detail")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionBonusSalesDetail.findAll", query = "SELECT p FROM PosTransactionBonusSalesDetail p"),
    @NamedQuery(name = "PosTransactionBonusSalesDetail.findBySync", query = "SELECT p FROM PosTransactionBonusSalesDetail p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionBonusSalesDetail.findByBonusSalesDetailId", query = "SELECT p FROM PosTransactionBonusSalesDetail p WHERE p.bonusSalesDetailId = :bonusSalesDetailId"),
    @NamedQuery(name = "PosTransactionBonusSalesDetail.findByBonusSalesDetailTotal", query = "SELECT p FROM PosTransactionBonusSalesDetail p WHERE p.bonusSalesDetailTotal = :bonusSalesDetailTotal"),
    @NamedQuery(name = "PosTransactionBonusSalesDetail.findByBonusSalesDetailBonus", query = "SELECT p FROM PosTransactionBonusSalesDetail p WHERE p.bonusSalesDetailBonus = :bonusSalesDetailBonus")})
public class PosTransactionBonusSalesDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "bonus_sales_detail_id")
    private Integer bonusSalesDetailId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "bonus_sales_detail_total")
    private BigDecimal bonusSalesDetailTotal;
    @Column(name = "bonus_sales_detail_bonus")
    private BigDecimal bonusSalesDetailBonus;
    @JoinColumn(name = "bonus_sales_detail_bonus_sales_id", referencedColumnName = "bonus_sales_id")
    @ManyToOne(optional = false)
    private PosTransactionBonusSales bonusSalesDetailBonusSalesId;
    @JoinColumn(name = "bonus_sales_detail_sales_id", referencedColumnName = "sales_id")
    @ManyToOne(optional = false)
    private PosMasterSales bonusSalesDetailSalesId;
    
    public PosTransactionBonusSalesDetail() {
    }

    public PosTransactionBonusSalesDetail(Integer bonusSalesDetailId) {
        this.bonusSalesDetailId = bonusSalesDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getBonusSalesDetailId() {
        return bonusSalesDetailId;
    }

    public void setBonusSalesDetailId(Integer bonusSalesDetailId) {
        this.bonusSalesDetailId = bonusSalesDetailId;
    }

    public BigDecimal getBonusSalesDetailTotal() {
        return bonusSalesDetailTotal;
    }

    public void setBonusSalesDetailTotal(BigDecimal bonusSalesDetailTotal) {
        this.bonusSalesDetailTotal = bonusSalesDetailTotal;
    }

    public BigDecimal getBonusSalesDetailBonus() {
        return bonusSalesDetailBonus;
    }

    public void setBonusSalesDetailBonus(BigDecimal bonusSalesDetailBonus) {
        this.bonusSalesDetailBonus = bonusSalesDetailBonus;
    }

    public PosTransactionBonusSales getBonusSalesDetailBonusSalesId() {
        return bonusSalesDetailBonusSalesId;
    }

    public void setBonusSalesDetailBonusSalesId(PosTransactionBonusSales bonusSalesDetailBonusSalesId) {
        this.bonusSalesDetailBonusSalesId = bonusSalesDetailBonusSalesId;
    }

    public PosMasterSales getBonusSalesDetailSalesId() {
        return bonusSalesDetailSalesId;
    }

    public void setBonusSalesDetailSalesId(PosMasterSales bonusSalesDetailSalesId) {
        this.bonusSalesDetailSalesId = bonusSalesDetailSalesId;
    }
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bonusSalesDetailId != null ? bonusSalesDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionBonusSalesDetail)) {
            return false;
        }
        PosTransactionBonusSalesDetail other = (PosTransactionBonusSalesDetail) object;
        if ((this.bonusSalesDetailId == null && other.bonusSalesDetailId != null) || (this.bonusSalesDetailId != null && !this.bonusSalesDetailId.equals(other.bonusSalesDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionBonusSalesDetail[ bonusSalesDetailId=" + bonusSalesDetailId + " ]";
    }
    
}
